<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>驳回</title>
    <jsp:include page="../../head.jsp"/>
</head>
<script type="text/javascript">
    var id = location.hash.substr(1);
    var type = "1";
    var formSetting = {
            title: "驳回",
            module: "save",
            numCount: "1",
            columns: [{
                name: "declaId",
                label: "报关单id",
                value: "${id}",
                hidden: true,
                validate: 'validate[required]',
            }, {
                name: "applyReasonId",
                label: "驳回原因",
                validate: 'validate[required]',
                type: "dropdown",
                dropdownType: "ajax",
                url: "/api/dictionary/search?dtGroupCode=reject_reason",
                op: "eq",
                minLength: 0,
                success: function (data) {
                    data = data.content;
                    var array = new Array();
                    $.each(data, function (i, n) {
                        array.push([n["dtValue"], n["dtId"]]);
                    });
                    return array;
                }
            }, {
                name: "remark",
                label: "驳回详细说明",
                type: "textarea",
            }
            ],
            form: {
                'url': '../business/reject/supplier/reject',
                'ajaxForm': {
                    success: function (result) {
                        jw.alert(result.msg, {
                            onOk: function () {
                                if (result.result) {
                                    window.close();
                                    window.opener.location.href = "../business/toValidMain";
                                }
                            }
                        });
                    }
                }
            }
            ,
            buttons: {
                custom: [
                    {
                        id: "cancleBtn",
                        value: "取消",
                        click: function () {
                            jw.close();
                            window.close();
                        }
                    }
                ]
            }
        }
    ;
    $(document).ready(function () {
        $("#rejectForm").mrdForm(formSetting);
    });
</script>
<body>
<div style="width: 100%">
    <div id="rejectForm"></div>
</div>
</body>
</html>
